package cn.youth996.rule;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import com.netflix.loadbalancer.RoundRobinRule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author Zhan Xinjian
 * @date 2021/4/11
 */
@Configuration
public class MyRules {
    @Bean
    public IRule getMyRule() {
        return new RandomRule();
    }

    public IRule getRoundRule() {
        return new RoundRobinRule();
    }
}
